<template name="views_dashboard">
    {{#if isMist }}
      {{>mist_alert}}
    {{/if}}

    <div class="dapp-container">

        <h1>{{{i18n "wallet.accounts.title"}}}</h1>

        {{#if pendingConfirmations}}
            <h2>{{i18n 'wallet.transactions.pendingConfirmations'}}</h2>

            {{> elements_transactions_table collection="PendingConfirmations" ids=pendingConfirmations }}

        {{/if}}

        {{#if hasAccounts}}

            <h2>{{i18n "wallet.accounts.accountsTitle"}}</h2>
            <p>
                {{i18n "wallet.accounts.accountsDescription"}}
            </p>
            <div class="dapp-clear-fix"></div>

            <div class="wallet-box-list">
                {{#each accounts}}
                    {{> elements_account account=_id}}
                {{/each}}
            </div>

            {{#if isMist}}
                <button class="wallet-box create account">
                    <div class="account-pattern">
                        +
                    </div>
                    <h3>{{i18n "wallet.app.buttons.addAccount"}}</h3>
                </button>
            {{/if}}


            <h2>{{i18n "wallet.accounts.walletsTitle"}}</h2>

            {{#if hasMinimumBalance}}
                <p>
                    {{i18n "wallet.accounts.walletsDescription"}}
                </p>
            {{else}}
                <p>
                    {{{i18n "wallet.accounts.walletsDescriptionNotEnoughFunds"}}}
                </p>
            {{/if}}



            <div class="wallet-box-list">
            {{#each wallets}}
                {{> elements_account account=_id wallets=true}}
            {{/each}}
            </div>

            {{#if hasMinimumBalance}}
                <a href="{{pathFor route='createAccount'}}" class="wallet-box create">
                    <div class="account-pattern">
                        +
                    </div>
                    <h3>{{i18n "wallet.app.buttons.addWallet"}}</h3>
                </a>
            {{/if}}

        {{else}}
            <div class="col col-5 mobile-full ">
                <br>
                {{#if isMist}}
                    <button class="wallet-box create account">
                        <div class="account-pattern">
                            +
                        </div>
                        <h3>{{i18n "wallet.app.buttons.addAccount"}}</h3>
                    </button>
                {{/if}}
            </div>
            <div class="col col-5 mobile-full ">
                <h3>{{i18n "wallet.app.texts.noAccounts.title"}}</h3>
                <p>{{i18n "wallet.app.texts.noAccounts.text"}}</p>
            </div>
        {{/if}}

        <div class="dapp-clear-fix"></div>


        {{#if allTransactions}}
            <h2>{{i18n 'wallet.transactions.latest'}}</h2>

            {{> elements_transactions_table limit=5}}

        {{else}}

            <h2>{{i18n 'wallet.transactions.none'}}</h2>
        {{/if}}
    </div>
</template>
